package cn.tedu.controller;

import cn.tedu.pojo.student;
import cn.tedu.service.studentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("student")
@CrossOrigin
public class studentController {

    @Autowired
    private studentService studentService;
    @RequestMapping("get")
    public List<student> get(){
        return studentService.getall();
    }
    @RequestMapping("insert")
    public void insert(student student){
        studentService.insertStu(student);
    }
}
